<div id="active-create-view">
  <div class="pageheader">
    <h2><i class="fa fa-home"></i>活动创建</h2>
    <!--<div class="al-header-right">-->
    <!--<button type="button" class="btn btn-primary" ng-click="saveSetting()">保存</button>-->
    <!--<button type="button" class="btn btn-default" ng-click="resetAuthority()">重置</button>-->
    <!--</div>-->
  </div>
  <div class="page">
    <div class="al-list-container">
      <ng-form name="modalForm" class="form-horizontal" role="form">
        <div class="form-group">
          <label class="col-sm-3 control-label">活动类型</label>
          <div class="col-sm-6">
            <select ng-model="data.type" class="form-control"
                    ng-options="option.code as option.name for option in activeTypeList">
            </select>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-3 control-label">活动名称<span class="attr-need">*</span></label>
          <div class="col-sm-6">
            <input class="form-control" ng-model="data.name" type="text"
                   required name="name"
                   placeholder="" maxlength="50"/>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-3 control-label">活动封面<span class="attr-need">*</span></label>
          <div class="col-sm-8">
            <div class="input-group">
              <input class="form-control" ng-model="data.thumb" type="text" required
                     placeholder=""/>
              <span class="input-group-btn">
                <button type="button" class="btn btn-default" ng-click="editThumb()">
                  <i class="glyphicon glyphicon-folder-open"></i>
                </button>
              </span>
            </div>
          </div>
        </div>
        <div class="form-group" ng-if="data.thumb">
          <div class="col-sm-offset-3 col-sm-6">
            <div class="wf-thumbnail-container">
              <img ng-src="{{data.thumb}}" class="wf-thumbnail" alt="找不到该图片">
            </div>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-3 control-label">发起方</label>
          <div class="col-sm-6">
            <input class="form-control" ng-model="data.organizer" type="text"
                   placeholder="" maxlength="50"/>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-3 control-label">短信验证</label>
          <div class="col-sm-6">
            <select ng-model="data.needVerify" class="form-control"
                    ng-options="option.value as option.name for option in needVerifyList">
            </select>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-3 control-label">收费类型</label>
          <div class="col-sm-6">
            <select ng-model="data.needFee" class="form-control"
                    ng-options="option.value as option.name for option in costTypeList">
            </select>
          </div>
        </div>
        <div class="form-group" ng-show="data.needFee">
          <label class="col-sm-3 control-label">收费金额<span class="attr-need">*</span></label>
          <div class="col-sm-6">
            <input class="form-control" ng-model="data.enterFee" type="text"
                   ng-required="data.needFee" name="enterFee" ng-pattern="/^(0|[1-9][0-9]*)+(.[0-9]{1,2})?$/"
                   placeholder="" maxlength="50"/>
            <div class="help-block with-errors"
                 ng-if="modalForm.enterFee.$invalid && !modalForm.enterFee.$pristine">
              请填写有效的收费金额
            </div>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-3 control-label">活动地址</label>
          <div class="col-sm-6">
            <div class="input-group">
              <input class="form-control" ng-model="data.address" type="text" disabled
                     placeholder="" maxlength="50"/>
              <span class="input-group-btn">
                <button type="button" class="btn btn-default" ng-click="editAddress()">
                  <i class="glyphicon glyphicon-map-marker"></i>
                </button>
              </span>
            </div>
          </div>
        </div>
        <!--<wf-gaode-map ng-if="gaodeShowing"></wf-gaode-map>-->
        <div class="form-group">
          <label class="col-sm-3 control-label">活动简介</label>
          <div class="col-sm-6">
            <input class="form-control" ng-model="data.brief" type="text"
                   placeholder="" maxlength="50"/>
          </div>
        </div>

        <div class="form-group">
          <label class="col-sm-3 control-label">报名信息</label>
          <div class="col-sm-6">
            <button class="btn btn-primary" ng-click="configParam()">配置报名字段</button>
            <span class="main-text-color">已配置了{{data.basicParamList.length+data.otherParamList.length+data.customParamList.length}}个字段&nbsp;></span>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-3 control-label">活动开始时间</label>
          <div class="col-sm-6">
            <div class="input-group">
              <input class="form-control" type="text" uib-datepicker-popup="yyyy-MM-dd HH:mm"
                     ng-model="data.startTime" ng-pattern="/^(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2})$/"
                     is-open="startTime" maxlength="19"
                     close-text="关闭" current-text="今天" clear-text="清空"
                     placeholder=""/>
              <span class="input-group-btn">
                <button type="button" class="btn btn-default" ng-click="startTime=true">
                  <i class="glyphicon glyphicon-calendar"></i>
                </button>
              </span>
            </div>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-3 control-label">活动结束时间</label>
          <div class="col-sm-6">
            <!--datepicker-options="dateOptions"-->
            <div class="input-group">
              <input class="form-control" type="text" uib-datepicker-popup="yyyy-MM-dd HH:mm"
                     ng-model="data.endTime" ng-pattern="/^(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2})$/"
                     is-open="endTime" maxlength="19"
                     close-text="关闭" current-text="今天" clear-text="清空"
                     placeholder=""/>
              <span class="input-group-btn">
                <button type="button" class="btn btn-default" ng-click="endTime=true">
                  <i class="glyphicon glyphicon-calendar"></i>
                </button>
              </span>
            </div>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-3 control-label">报名开始时间</label>
          <div class="col-sm-6">
            <div class="input-group">
              <input class="form-control" type="text" uib-datepicker-popup="yyyy-MM-dd HH:mm"
                     ng-model="data.enterStart" ng-pattern="/^(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2})$/"
                     is-open="enterStart" maxlength="19"
                     close-text="关闭" current-text="今天" clear-text="清空"
                     placeholder=""/>
              <span class="input-group-btn">
                <button type="button" class="btn btn-default" ng-click="enterStart=true">
                  <i class="glyphicon glyphicon-calendar"></i>
                </button>
              </span>
            </div>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-3 control-label">报名截止时间</label>
          <div class="col-sm-6">
            <!--datepicker-options="dateOptions"-->
            <div class="input-group">
              <input class="form-control" type="text" uib-datepicker-popup="yyyy-MM-dd HH:mm"
                     ng-model="data.enterEnd" ng-pattern="/^(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2})$/"
                     is-open="enterEnd" maxlength="19"
                     close-text="关闭" current-text="今天" clear-text="清空"
                     placeholder=""/>
              <span class="input-group-btn">
                <button type="button" class="btn btn-default" ng-click="enterEnd=true">
                  <i class="glyphicon glyphicon-calendar"></i>
                </button>
              </span>
            </div>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-3 control-label">活动内容</label>
          <div class="col-sm-8">
            <button class="btn btn-primary" ng-click="uploadPicture()">上传内容图片</button>
          </div>
          <div class="col-sm-1"></div>

        </div>
        <div class="form-group">
          <div class="col-sm-8 col-sm-offset-3" ng-repeat="item in data.pictures">
            <div class="input-group">
              <input class="form-control" ng-model="item" type="text"
                     placeholder=""/>
              <span class="input-group-btn">
                <button type="button" class="btn btn-default" ng-click="removePicture(item)">
                  <i class="glyphicon glyphicon-remove"></i>
                </button>
              </span>
            </div>
          </div>
        </div>
        <div class="form-group">
          <div class="col-sm-9 col-sm-offset-3">
            <div class="panel panel-default" style="width: 414px;">
              <div class="panel-body">
                <div text-angular ng-model="data.content" class="ui-editor">
                </div>
              </div>
            </div>
            <!--<textarea rows="5" ng-model="data.content" class="form-control"></textarea>-->
          </div>
        </div>
        <div class="form-group" style="margin-top: 36px">
          <label class="col-sm-5 control-label"></label>
          <!--<div class="col-sm-3">-->
          <!--<button type="button" class="btn btn-default" ng-click="resetData()">重置</button>-->
          <!--</div>-->
          <div class="col-sm-4">
            <button type="button" class="btn btn-info" ng-disabled="modalForm.$invalid"
                    ng-click="saveData()">创建活动
            </button>
          </div>
        </div>
      </ng-form>
    </div>
  </div>
</div>
